package org.shiwen.week6;

public class StudentV2 {
    //用private修饰属性，从而达到不让外部类可以修改属性的目的
    private String name;
    private int age;
    private String gender;
    private String ID;

    public StudentV2(String xingming, int nianling, String xingbie, String xuehao) {
        name = xingming;
        age = nianling;
        gender = xingbie;
        ID = xuehao;
    }

    public StudentV2() {
    }
    public void showInfo() {
        System.out.println("姓名：" + name + "，年龄：" + age + "，性别：" + gender + "，学号：" + ID);
    }
}
